home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4694 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  942 b 

  1. Path: news.cencom.net!ns!tanp
  2. From: tanp@ns (Bill Wendling)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Compiler error on long multiplication?
  5. Date: 6 Feb 1996 07:46:50 GMT
  6. Organization: Cen-Com Internet
  7. Message-ID: <4f711a$rt1@news.cencom.net>
  8. References: <4f4fr0$pea@newnews.iafrica.com>
  9. NNTP-Posting-Host: ns.cencom.net
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Pieter Malan inexplicably wrote:
  13. } void main()
  14.   ^^^^^^^^^^^ oops!  (int main(void))
  15. } {
  16. } unsigned long a;  //OR SIGNED
  17. } unsigned long x;
  18.  
  19. }         a = 1;
  20. }         x = (a * 100L) * 100L;    // x = 13379344 WRONG!!!
  21. }         a = 100;
  22. }         x = a * 100L;        // x = 10000
  23.  
  24. } }
  25.  
  26. You might have a bug in your compiler.  Have the compiler make an assembly
  27. listing of the code.  Then repost that.
  28.  
  29.  
  30. --
  31. Bill Wendling         | "Pinky, are you thinking what I'm thinking?"
  32. tanp@ns.cencom.net  | "I think so, Brain, but burlap chafes me so."
  33. "Boom Shanka"       | Finger me for my Geek Code...NOW!
  34.